package com.example.demo.controller;

import com.example.demo.entity.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("student")
public class StudentController {
    @RequestMapping("saveStudent")
    public ModelAndView saveStudent(Student student){
        System.out.println(student);
        ModelAndView mv = new ModelAndView();
        mv.setViewName("reg_success"); // 是templates下的html文件
        mv.addObject("stu",student);
        return mv;
    }
}
